package com.starlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.starlink.common.PageInfoTwo;
import com.starlink.model.domain.MallBooksDO;
import com.starlink.model.request.save.MallBooksSaveRequest;
import com.starlink.model.request.MallBooksRequest;
import com.starlink.model.vo.MallBooksVO;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author zhanghong
 */
public interface MallBooksService extends IService<MallBooksDO> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    MallBooksVO getByKey(long id);
    /**
     * 分页查询，手动分页
     * @param request
     * @return
     */
    PageInfoTwo<MallBooksVO> pageQuery(MallBooksRequest request);
    /**
     * 列表查询,排序字段不为空的十个商品排前面，后面根据时间降序排序
     * @param request
     * @return
     */
    List<MallBooksVO> listQuery(MallBooksRequest request);
    /**
     * 新增
     * @param request
     * @return
     */
    Boolean add(MallBooksSaveRequest request);
    /**
     * 根据主键更新
     * @param request
     * @return
     */
    Boolean updateByKey(MallBooksSaveRequest request);
    /**
     * 根据主键删除
     * @param id
     * @return
     */
    Boolean deleteDOById(String id);

    /**
     * 管理端，书籍列表分页查询
     * @param request
     * @param pageable
     * @return
     */
    PageInfo<List<MallBooksVO>> pagingQuery(MallBooksRequest request, Pageable pageable);

    /**
     * 随机查询同分类书籍
     * @param mallBooksId
     * @return
     */
    List<MallBooksVO> selectRandomBooks(Long mallBooksId);

    Boolean updateDO(MallBooksSaveRequest mallBooksRequest);

    /**
     * 根据书包id查询书包书籍图片集合
     * @param schoolbagGroupBagId
     * @return
     */
    List<MallBooksDO> queryByGroupBagId(Long schoolbagGroupBagId);

    Boolean importBooksExcel(MultipartFile file);
}